#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tlpi.h"

int
main(int argc, char *argv[])
{
	pid_t pid;

	if((pid = fork())== -1)
		errExit("fork() failed");

	if(pid != 0)
	{
		printf("Parent PID=%ld\n", (long)getpid());
		sleep(10);
		printf("Parent process finished\n");
		exit(EXIT_SUCCESS);
	}

	for(;;)
	{
		printf("child PID=%ld, PPID=%ld\n", (long)getpid(), (long)getppid());	
		sleep(3);
	}
}
